unit FRM_MENU;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DynamicSkinForm, Menus, StdCtrls, pngimage, ExtCtrls, ImgList,
  SkinCtrls;

type
  TForm5 = class(TForm)
    spDynamicSkinForm1: TspDynamicSkinForm;
    spSkinStatusBar1: TspSkinStatusBar;
    spSkinGroupBox1: TspSkinGroupBox;
    Image2: TImage;
    Image3: TImage;
    Label2: TLabel;
    Label3: TLabel;
    spSkinGroupBox2: TspSkinGroupBox;
    Image5: TImage;
    Label4: TLabel;
    Image4: TImage;
    Label5: TLabel;
    Image1: TImage;
    Label1: TLabel;
    spSkinLabel1: TspSkinLabel;
    spSkinGroupBox3: TspSkinGroupBox;
    Image6: TImage;
    Label6: TLabel;
    Image7: TImage;
    Label7: TLabel;
    Image8: TImage;
    Label8: TLabel;
    Image9: TImage;
    Label9: TLabel;
    Image10: TImage;
    Label10: TLabel;
    Image11: TImage;
    Label11: TLabel;
    Image12: TImage;
    Label12: TLabel;
    Image13: TImage;
    Image14: TImage;
    Image15: TImage;
    spSkinStatusPanel1: TspSkinStatusPanel;
    spSkinStatusPanel2: TspSkinStatusPanel;
    spSkinStatusPanel3: TspSkinStatusPanel;
    spSkinStatusPanel4: TspSkinStatusPanel;
    Timer1: TTimer;
    procedure FormCreate(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure Image7Click(Sender: TObject);
    procedure Image2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form5: TForm5;

implementation

uses FRM_LOGIN, FRM_BROWSEFUNCIONARIOS, FRM_CONSULTA_RESERVAS_QUARTOS,
  DATA_MODULE, FRM_CONSULTA_FUNCIONARIOS;

{$R *.dfm}

procedure TForm5.FormCreate(Sender: TObject);
var tipo : string;
begin
//  FRM_LOGIN.Form1.Close;
  Form5.Caption := '';

  DataModule1.IB_SQL.SQL.Text := 'select t2.grutipo from funcionarios t1 inner join grupos t2 on (t1.grucodigo = t2.grucodigo) where t1.funcodigo = :CODIGO';
      DataModule1.IB_SQL.ParamByName('CODIGO').AsInteger := Form1.CodigoUsuario;
  //    DataModule1.IB_SQL.ParamByName('LOGIN').AsString := login;
//      SQLQuery1.ParamByName('email').AsString := EMail;

      DataModule1.IB_FUNCIONARIOS.StartTransaction;
      DataModule1.IB_SQL.ExecQuery;
      tipo := DataModule1.IB_SQL.FieldByName('grutipo').AsString;
//      ShowMessage(FloatToStr(DataModule1.IB_SQL.FieldByName('funcodigo').AsInteger));
      DataModule1.IB_SQL.Close;
      DataModule1.IB_FUNCIONARIOS.Commit;
       //ShowMessage(tipo);
      if tipo = 'N' then
      begin
        spSkinGroupBox3.Visible := False;
      end;


end;

procedure TForm5.Image2Click(Sender: TObject);
begin
  FRM_CONSULTA_RESERVAS_QUARTOS.Form9.Show;
end;

procedure TForm5.Image7Click(Sender: TObject);
begin
//frmform7.show;
FrmListaFuncionarios.show;

end;

procedure TForm5.FormClose(Sender: TObject; var Action: TCloseAction);
begin

    Application.Terminate;

end;

procedure TForm5.Timer1Timer(Sender: TObject);
begin

  spSkinStatusPanel1.Caption := ' '+datetostr(date);
  spSkinStatusPanel2.Caption := ' '+timetostr(now);
  spSkinStatusPanel3.Caption := FRM_LOGIN.Form1.NomeHotel;
  spSkinStatusPanel4.Caption := FRM_LOGIN.Form1.NomeUsuario;

end;

end.
